<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/ZendSkeletonJhub1_Admin for the canonical source repository
 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

return array(
    'controllers' => array(
        'invokables' => array(
            'Jhub1_Admin\Controller\Index' => 'Jhub1_Admin\Controller\IndexController',
            'Jhub1_Admin\Controller\Auth'  => 'Jhub1_Admin\Controller\AuthenticateController',
            'Jhub1_Admin\Controller\Hub'  => 'Jhub1_Admin\Controller\HubController',
            'Jhub1_Admin\Controller\Myaccount'  => 'Jhub1_Admin\Controller\MyaccountController',
            'Jhub1_Admin\Controller\Options'  => 'Jhub1_Admin\Controller\OptionsController',
            'Jhub1_Admin\Controller\Ajax'  => 'Jhub1_Admin\Controller\AjaxController',
            'Jhub1_Admin\Controller\Endpoint'  => 'Jhub1_Admin\Controller\EndpointController'
        ),
    ),
    'session' => array(
        'remember_me_seconds' => 60,
        'use_cookies' => true,
        'cookie_httponly' => true,
    ),
    'router' => array(
        'routes' => array(
            'home' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/',
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Index',
                        'action'     => 'index',
                    ),
                ),
            ),
            'passwordreminder' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/passwordreminder',
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Index',
                        'action'     => 'passwordreminder',
                    ),
                ),
            ),
            'register' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/register',
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Index',
                        'action'     => 'register',
                    ),
                ),
            ),
            //link to activate account from email
            'activateaccount' => array(
                'type' => 'segment',
                'options' => array(
                    'route'    => '/activateaccount[/:code]',
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Index',
                        'action'     => 'activateaccount',
                    ),
                ),
            ),
            //link to trigger resend activation email event
            'resendactivationemail' => array(
                'type' => 'segment',
                'options' => array(
                    'route'    => '/resendactivationemail[/:code]',
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Index',
                        'action'     => 'resendactivationemail',
                    ),
                ),
            ),
            //Information about activation page
            'activate' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/activate',
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Index',
                        'action'     => 'activate',
                    ),
                ),
            ),
/*            'welcome' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/welcome',
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Index',
                        'action'     => 'welcome',
                    ),
                ),
            ),*/
            'authenticate' => array(
                'type'    => 'segment',
                'options' => array(
                    'route'    => '/authenticate[/:action]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*'
                    ),
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Auth',
                        'action'     => 'index'
                    ),
                ),
            ),
            'logout' => array(
                'type'    => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/logout',
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Auth',
                        'action'     => 'logout'
                    ),
                ),
            ),
            'options' => array(
                'type'    => 'segment',
                'options' => array(
                    'route'    => '/options[/:action]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*'
                    ),
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Options',
                        'action'     => 'index'
                    ),
                ),
            ),
            'hub' => array(
                'type'    => 'segment',
                'options' => array(
                    'route'    => '/hub[/:action]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*'
                    ),
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Hub',
                        'action'     => 'index'
                    ),
                ),
            ),
            'endpoint' => array(
                'type'    => 'segment',
                'options' => array(
                    'route'    => '/endpoint[/:action]',
                    'constraints' => array(
                        'action' => '[a-zA-Z][a-zA-Z0-9_-]*'
                    ),
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Hub',
                        'action'     => 'index'
                    ),
                ),
            ),
            'hub_myaccount' => array(
                'type' => 'Zend\Mvc\Router\Http\Literal',
                'options' => array(
                    'route'    => '/hub/myaccount',
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Myaccount',
                        'action'     => 'index',
                    ),
                ),
            ),
            'ajax' => array(
                'type'    => 'segment',
                'constraints' => array(
                    'action' => '[a-zA-Z][a-zA-Z0-9_-]*'
                ),
                'options' => array(
                    'route'    => '/ajax[/:action]',
                    'defaults' => array(
                        'controller' => 'Jhub1_Admin\Controller\Ajax',
                    ),
                ),
            ),
            // The following is a route to simplify getting started creating
            // new controllers and actions without needing to create a new
            // module. Simply drop new controllers in, and you can access them
            // using the path /Jhub1_Admin/:controller/:action
/*            'Jhub1_Admin' => array(
                'type'    => 'Literal',
                'options' => array(
                    'route'    => '/Jhub1_Admin',
                    'defaults' => array(
                        '__NAMESPACE__' => 'Jhub1_Admin\Controller',
                        'controller'    => 'Index',
                        'action'        => 'index',
                    ),
                ),
                'may_terminate' => true,
                'child_routes' => array(
                    'default' => array(
                        'type'    => 'Segment',
                        'options' => array(
                            'route'    => '/[:controller[/:action]]',
                            'constraints' => array(
                                'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
                                'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
                            ),
                            'defaults' => array(
                            ),
                        ),
                    ),
                ),
            ),*/
        ),
    ),
    'service_manager' => array(
        'factories' => array(
            'translator' => 'Zend\I18n\Translator\TranslatorServiceFactory',
        ),
    ),
    'controller_plugins' => array(
        'invokables' => array(
            'authCheck'  => 'Jhub1_Admin\Controller\Plugin\AuthenticationCheck'
        ),
    ),
    'translator' => array(
        'locale' => 'en_US',
        'translation_file_patterns' => array(
            array(
                'type'     => 'gettext',
                'base_dir' => __DIR__ . '/../language',
                'pattern'  => '%s.mo',
            ),
        ),
    ),
    'view_manager' => array(
        'display_not_found_reason' => true,
        'display_exceptions'       => true,
        'doctype'                  => 'HTML5',
        'not_found_template'       => 'error/404',
        'exception_template'       => 'error/index',
        'template_map' => array(
            'layout/layout'           => __DIR__ . '/../view/layout/layout.phtml',
            'jhub1_admin/index/index' => __DIR__ . '/../view/jhub1_admin/index/index.phtml',
            'error/404'               => __DIR__ . '/../view/error/404.phtml',
            'error/index'             => __DIR__ . '/../view/error/index.phtml',
        ),
        'template_path_stack' => array(
            __DIR__ . '/../view',
        ),
        'strategies' => array(
            'ViewJsonStrategy',
        ),
    ),
/*    'doctrine' => array(
        'driver' => array(
            'Jhub1_app_driver' => array(
                'class' => 'Doctrine\ORM\Mapping\Driver\AnnotationDriver',
                'cache' => 'array',
                'paths' => array(__DIR__ . '/../src/Jhub1_Admin/Entity')
            ),
            'orm_default' => array(
                'drivers' => array(
                    'Jhub1_Admin\Entity' => 'Jhub1_app_driver'
                )
            )
        )
    )*/
);
